#!/usr/bin/env python
# encoding: utf-8

#  minios ->
#            | conf
#            | data
#            | doc
#            | bin/
#            | etc/

import os
import os.path

root = '$HOME/archdotfiles'
folderArray = ['etc','bin','conf','doc','data']
dotfilesArray = ['.bashprofile',
    '.profile',
    '.bash_profile',
    '.bashrc',
    '.notes',
    '.todo',
    '.curlrc',
    '.fbtermrc',
    '.gemrc',
    '.gitconfig',
    '.npmrc',
    '.wgetrc',
    '.Xdefaults',
    '.xinitrc',
    '.xprofile' ,
    '.calcurse',
    '.emacs',
    '.emacs.d',
    '.vimrc',
    '.vim',
    '.w3m']

def link(source,target):
    if not os.path.isfile(target) and not os.path.isdir(target):
        print('--------------------------------')
        print('Making link of'+ source + ' to ' + target)
        print('--------------------------------')
        #os.symlink(source,target)
    else:
        print(target + ' existes,quiting')

def linkingDotFiles():
    for item in dotfilesArray:
        source = root+os.sep+ folderArray[1]+os.sep+item
        target = root+os.sep+item
        link(source,target)

linkingDotFiles()


if __name__ == '__main__':
    print("easy setup your workspace environment")
